﻿namespace NetMicro.ExcelMapper
{
    /// <summary>
    /// 行映射
    /// </summary>
    public class RowInfo<TTarget> : IRowInfo
    {
        #region Properties

        /// <summary>
        /// 行数
        /// </summary>
        public int RowNumber { get; set; }

        /// <summary>
        /// 值
        /// </summary>
        public TTarget Value { get;  set; }

        /// <summary>
        /// 第一个错误的列索引
        /// </summary>
        public int ErrorColumnIndex { get; set; }

        /// <summary>
        /// 第一个错误的信息
        /// </summary>
        public string ErrorMessage { get; set; }

        #endregion

        #region Constructors

        /// <summary>
        /// 初始化
        /// </summary>
        /// <param name="rowNumber">行数</param>
        /// <param name="value">值</param>
        /// <param name="errorColumnIndex">第一个错误的索引</param>
        /// <param name="errorMessage">第一个错误的信息</param>
        public RowInfo(int rowNumber, TTarget value, int errorColumnIndex, string errorMessage)
        {
            RowNumber = rowNumber;
            Value = value;
            ErrorColumnIndex = errorColumnIndex;
            ErrorMessage = errorMessage;
        }

        #endregion
    }
}
